<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/vue.js"></script>
</head>
<body>
    <div id="app">
        {{msg}}<br>
        <input type="button" value="点击" v-on:click="myClick('007')"><br>
        <input type="button" value="确定" @click="buClick">
        <div style="width: 200px;height: 200px;border: 1px solid #000000" @click="divClick">
            <input type="button" value="添加" @click.stop="add($event)">
        </div>
    </div>

    <script>
        var vueObj = new Vue({
            el:"#app",
            data:{
                msg:"现在是冬天"
            },
            methods:{
                myClick:function (info) {
                    alert(info)
                },
                buClick(){
                    // 访问Vue对象的属性或别的方法，需要加this
                    this.msg = "马上就要过年了";
                    this.myClick("你要红包，还是给别人发红包");
                },
                add(ev){
                    alert(ev.pageX);
                },
                divClick(){
                    alert("div点中");
                }
            }
        });
    </script>
</body>
</html>